﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using JMY_Models;

namespace JMY_DAL
{
    public class FindHospitaDAL:JMY_IDAL.FindHospitaIDAL
    {
        Dbherper d = new Dbherper();
        
        /// <summary>
        /// 显示医院列表
        /// </summary>
        /// <returns></returns>
        public List<T_Hospital_Infos> InfosShow()
        {
            DataTable dt = d.GetTable("select * from T_Hospital_Infos");
            List<T_Hospital_Infos> list = new List<T_Hospital_Infos>();
            foreach(DataRow s in dt.Rows)
            {
                T_Hospital_Infos t = new T_Hospital_Infos();
                t.T_Hos_ID = Convert.ToInt32(s["T_Hos_ID"]);
                t.T_Hos_Name = s["T_Hos_Name"].ToString();
                t.T_Hos_Area = s["T_Hos_Area"].ToString();
                t.T_Hos_Address = s["T_Hos_Address"].ToString();
                t.T_Hos_Grade = s["T_Hos_Grade"].ToString();
                t.T_Hos_OrderTime = s["T_Hos_OrderTime"].ToString();
                t.T_Hos_Appointment = s["T_Hos_Appointment"].ToString();
                t.T_Hos_Intor = s["T_Hos_Intor"].ToString();
                t.T_Hos_Hint = s["T_Hos_Hint"].ToString();
                list.Add(t);
                
            }
            return list;
        }

        public List<T_Doctor_Combo_Model> ComboShow()
        {
            DataTable dt = d.GetTable("select * from T_Doctor_Combo");
            List<T_Doctor_Combo_Model> list = new List<T_Doctor_Combo_Model>();
            foreach(DataRow s in dt.Rows)
            {
                T_Doctor_Combo_Model t = new T_Doctor_Combo_Model();
                t.T_Combo_ID = Convert.ToInt32(s["T_Combo_ID"]);
                t.T_Combo_Name = s["T_Combo_Name"].ToString();
                t.T_Combo_picture = s["T_Combo_picture"].ToString();
                t.T_Combo_Price = Convert.ToInt32(s["T_Combo_Price"]);
                t.T_Combo_Order_Num = Convert.ToInt32(s["T_Combo_Order_Num"]);
                t.T_Combo_Type_Sex = Convert.ToInt32(s["T_Combo_Type_Sex"]);
                t.T_Combo_Type_Age = Convert.ToInt32(s["T_Combo_Type_Age"]);
                t.T_Combo_Type_Price = Convert.ToInt32(s["T_Combo_Type_Price"]);
                t.T_Combo_Docid = Convert.ToInt32(s["T_Combo_Docid"]);
                list.Add(t);



            }
            return list;
        }



    }
}
